import {createRouter,createWebHashHistory} from 'vue-router'
import Login from "../pages/login.vue"
import Home from "../pages/home.vue"

export const routes=[
    {
        path:'/',
        redirect:'/home'
    },
    {
        name:'home',
        path:'/home',
        component:Home
    },
    {
        name:'login',
        path:'/login',
        component:Login
    },
    {
        name:'index',
        path:'/index',
        component:()=>import("../pages/index.vue")
    },
    {
        path:'/nextTick',
        component:()=>import("../pages/nextTick.vue")
    },
    {
        path:'/Ref',
        component:()=>import("../pages/Ref.vue")
    },
    {
        path:'/customRef',
        component:()=>import("../pages/customRef.vue")
    },
    {
        path:"/provide",
        component:()=>import("../pages/provide.vue")
    },
    {
        path:"/messagebox",
        component:()=>import("../pages/messageBox/index.vue")
    }
]

const router=createRouter({
    scrollBehavior:()=>({left:0,top:0}),
    history:createWebHashHistory(),
    routes
})

router.beforeEach((to,from,next)=>{
    // console.log(to,from);
    next()
})

export default router